import React from "react";

import { BrowserRouter as Router,HashRouter, Route, Redirect } from "react-router-dom";
// import { Route } from "react-router";
import Home from "../pages/home/index.jsx";
import Task from "../pages/task/index.jsx";
import TaskDetail from "../pages/task/taskDetail.jsx";
import Mine from "../pages/mine/index.jsx";
import Bank from "../pages/mine/bankCard/index.jsx";
import Record from "../pages/mine/record/index.jsx";
import Verify from "../pages/mine/verified/index.jsx";
import Protocol from "../pages/protocol/index.jsx";

import Repayment from "../pages/repayment/index.jsx"
import RepaymentDetail from "../pages/repayment/detail.jsx"
// 预支
import Advance from "../pages/advance/index.jsx";
import PreviewRecord from "../pages/advance/previewRecord/index.jsx";
import PreviewRecordDetail from "../pages/advance/previewRecord/detail.jsx";

/* 屏幕分辨率比例适配方案 */
class Routers extends React.Component {
  render() {
    return (
      <HashRouter>
        {/* 测试页 */}
        <Route exact component={Home} path="/" onEnter={()=>{document.title="首页"}}></Route>
        <Route exact component={Home} path="/home" onEnter={()=>{document.title="首页"}}></Route>
        <Route exact component={Task} path="/task" onEnter={()=>{document.title="任务"}}></Route>
        <Route exact component={Advance} path="/advance" onEnter={()=>{document.title="预支"}}></Route>
        <Route exact component={Mine} path="/mine" onEnter={()=>{document.title="我的"}}></Route>
        <Route exact component={Bank} path="/bank" onEnter={()=>{document.title="我的银行卡"}}></Route>
        <Route exact component={Record} path="/record" onEnter={()=>{document.title="发薪记录"}}></Route>
        <Route exact component={PreviewRecord} path="/previewRecord" onEnter={()=>{document.title="预支记录"}}></Route>
        <Route exact component={PreviewRecordDetail} path="/previewRecordDetail" onEnter={()=>{document.title="预支详情"}}></Route>
        <Route exact component={Verify} path="/verify" onEnter={()=>{document.title="实名认证"}}></Route>
        <Route exact component={Protocol} path="/protocol" onEnter={()=>{document.title="用户协议"}}></Route>
        <Route exact component={TaskDetail} path="/taskDetail" onEnter={()=>{document.title="任务详情"}}></Route>
        <Route exact component={Repayment} path="/repayment" onEnter={()=>{document.title="还款详情"}}></Route>
        <Route exact component={RepaymentDetail} path="/repaymentDetail" onEnter={()=>{document.title="还款详情"}}></Route>
        {/* <Redirect to="/home" /> */}
      </HashRouter>
    );
  }
}

export default Routers;
